package com.gaohe.scp.service.impl;

import java.util.List;
import com.gaohe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.scp.mapper.CsAddressMapper;
import com.gaohe.scp.domain.CsAddress;
import com.gaohe.scp.service.ICsAddressService;

/**
 * 用户地址Service业务层处理
 * 
 * @author liuxiangyu
 * @date 2025-03-25
 */
@Service
public class CsAddressServiceImpl implements ICsAddressService 
{
    @Autowired
    private CsAddressMapper csAddressMapper;

    /**
     * 查询用户地址
     * 
     * @param addressId 用户地址主键
     * @return 用户地址
     */
    @Override
    public CsAddress selectCsAddressByAddressId(Long addressId)
    {
        return csAddressMapper.selectCsAddressByAddressId(addressId);
    }

    /**
     * 查询用户地址列表
     * 
     * @param csAddress 用户地址
     * @return 用户地址
     */
    @Override
    public List<CsAddress> selectCsAddressList(CsAddress csAddress)
    {
        return csAddressMapper.selectCsAddressList(csAddress);
    }

    /**
     * 新增用户地址
     * 
     * @param csAddress 用户地址
     * @return 结果
     */
    @Override
    public int insertCsAddress(CsAddress csAddress)
    {
        csAddress.setCreateTime(DateUtils.getNowDate());
        return csAddressMapper.insertCsAddress(csAddress);
    }

    /**
     * 修改用户地址
     * 
     * @param csAddress 用户地址
     * @return 结果
     */
    @Override
    public int updateCsAddress(CsAddress csAddress)
    {
        csAddress.setUpdateTime(DateUtils.getNowDate());
        return csAddressMapper.updateCsAddress(csAddress);
    }

    /**
     * 批量删除用户地址
     * 
     * @param addressIds 需要删除的用户地址主键
     * @return 结果
     */
    @Override
    public int deleteCsAddressByAddressIds(Long[] addressIds)
    {
        return csAddressMapper.deleteCsAddressByAddressIds(addressIds);
    }

    /**
     * 删除用户地址信息
     * 
     * @param addressId 用户地址主键
     * @return 结果
     */
    @Override
    public int deleteCsAddressByAddressId(Long addressId)
    {
        return csAddressMapper.deleteCsAddressByAddressId(addressId);
    }
}
